Identifying selections are an important part of editing text files. A selection may indicate a range of characters on a single line, a number of lines, or even the entire file contents. To remove an existing selection, click anywhere in the editable area, or press one of the arrow keys.
The Code Editor allows three different types of selections to be created; normal selection, line selection and block selection. This topic introduces the three selection types and indicates how they may be created and used.
Most Windows users will be familiar with the concept of creating a selection from text. This type of selection can include one or more characters over one or more lines with the range extending from left to right and downwards.
To create a normal selection
Place the insertion point at the start of the selection, hold the mouse button down, and drag the insertion point to the end of the selection.
Place the insertion point at the start of the selection, hold down the SHIFT key, and click the insertion point to the end of the selection.
Place the insertion point at the start of the selection, hold down the SHIFT key, and use the cursor keys to move the insertion point to the end of the selection.
An existing selection may be extended or restricted by moving the insertion point using either the mouse or keyboard while keeping the SHIFT key pressed.
Tip |
You can quickly select an entire word by simply double-clicking on the word. |
A line selection encompasses the entire content of one or more lines. This can be particularly useful when working in languages that employ line based identifiers, such as line numbers and COBOL line tags.
To create a line selection
Click in the selection margin using the mouse, hold the mouse button down, and drag to the end of the selection.
From the Edit menu, select Select Line
A thin border is displayed around those line numbers that are considered to be included in the current selection. Although these line numbers will not be included in any clipboard operation, this is useful to determine what lines will be removed when deleting a selection and which lines may be joined together.
Block Selection, (also known as block-mode selection), differs greatly from the other selection types. Using a block selection, text can be highlighted from one 'column' to another 'column' just as cells may be highlighted in a spreadsheet.
This type of selection can be particularly useful when aligning code to improve readability. Once a block selection has been created it can be easily moved left or right or dragged to a new position using the mouse.
To create a block selection
Place the insertion point at the start of the selection, hold the mouse button and ALT key down, and drag the insertion point to the end of the selection.